/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BLL;

import DAL.ConnectUnit;
import DTO.Parameter_DTO;
import java.sql.CallableStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.HashSet;

/**
 *
 * @author Nguyen Phi Hung
 */
public class Parameter_BLL {
    
    ConnectUnit connection;
    
    public Parameter_BLL(){
        this.connection = DAL.DAL.getDAL();
    }
    public ResultSet ExcuteQuery(String procedure,String sql) throws SQLException, Exception
    {
        CallableStatement cs=this.connection.GetCallableStatement(procedure);
        cs.setString(1, sql);
        return cs.executeQuery();
    
    }
    public boolean Update(String procedure,Parameter_DTO info) throws Exception
    {
        CallableStatement cs=this.connection.GetCallableStatement(procedure);
        cs.setInt(1, info.getMinofDeposit());
        cs.setInt(2, info.getMinOfWithdraw());
        cs.setInt(3, info.getMinOfDepositPeriod());
        cs.setInt(4, info.getInterestFreePeriod());
        cs.setFloat(5,info.getMinOfAccountBalance());
        return cs.execute();
    }
   
}
